package com.westa.smallshop.data;

import android.os.Parcel;

/**
 * Created by cy on 11/4/16.
 */

public class GoodsItem extends Base {

    /**
     * goods_name : 自行车1
     * account_id : 111111
     * goods_pic : :8080/shop/goods_img/aa.jpg
     * goods_price : 22
     * goods_id : 1
     * goods_desc : 我是一个自行测
     * state : true
     */

    private String goods_name;
    private String account_id;
    private String goods_pic;
    private int goods_price;
    private int goods_id;
    private String goods_desc;
    private boolean state;

    public String getGoods_name() {
        return goods_name;
    }

    public void setGoods_name(String goods_name) {
        this.goods_name = goods_name;
    }

    public String getAccount_id() {
        return account_id;
    }

    public void setAccount_id(String account_id) {
        this.account_id = account_id;
    }

    public String getGoods_pic() {
        return goods_pic;
    }

    public void setGoods_pic(String goods_pic) {
        this.goods_pic = goods_pic;
    }

    public int getGoods_price() {
        return goods_price;
    }

    public void setGoods_price(int goods_price) {
        this.goods_price = goods_price;
    }

    public int getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(int goods_id) {
        this.goods_id = goods_id;
    }

    public String getGoods_desc() {
        return goods_desc;
    }

    public void setGoods_desc(String goods_desc) {
        this.goods_desc = goods_desc;
    }

    public boolean isState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public GoodsItem(String goods_name, String account_id, String goods_pic, int goods_price, int goods_id, String goods_desc, boolean state) {
        this.goods_name = goods_name;
        this.account_id = account_id;
        this.goods_pic = goods_pic;
        this.goods_price = goods_price;
        this.goods_id = goods_id;
        this.goods_desc = goods_desc;
        this.state = state;
    }

    public GoodsItem(){}

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(this.goods_name);
        dest.writeString(this.account_id);
        dest.writeString(this.goods_pic);
        dest.writeInt(this.goods_price);
        dest.writeInt(this.goods_id);
        dest.writeString(this.goods_desc);
        dest.writeByte(this.state ? (byte) 1 : (byte) 0);
    }

    protected GoodsItem(Parcel in) {
        super(in);
        this.goods_name = in.readString();
        this.account_id = in.readString();
        this.goods_pic = in.readString();
        this.goods_price = in.readInt();
        this.goods_id = in.readInt();
        this.goods_desc = in.readString();
        this.state = in.readByte() != 0;
    }

    public static final Creator<GoodsItem> CREATOR = new Creator<GoodsItem>() {
        @Override
        public GoodsItem createFromParcel(Parcel source) {
            return new GoodsItem(source);
        }

        @Override
        public GoodsItem[] newArray(int size) {
            return new GoodsItem[size];
        }
    };
}
